<?php
class Rating {
	function count_rating($my,$victories,$hittings,$koef = 1) {
		$delta = 0;
		foreach ($victories as $loser) {
			$delta += ($loser - $my + 100)/10;
		}
		foreach ($hittibgs as $winner) {
			$delta -= ($my - $winner + 100)/10;
		}
		
		return $koef*$delta;
	}
}